package com.ctgu.tengyun.domain;

import com.ctgu.tengyun.exception.ConvertException;

public enum TemplateType implements HasDefaultInterface<TemplateType>{

    unknown(-1),
    guide_tech(1),              //技术说明书
    guide_use(2),               //使用说明书
    guide_maintenance(3),      //维护说明书
    day_fix(4),                 //日检修
    week_fix(5),                //周检修
    month_fix(6),               //月检修
    ;

    private Integer value;

    TemplateType(Integer value) {
        this.value = value;
    }

    @Override
    public TemplateType getDefault() {
        return unknown;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static TemplateType valueOf(Integer value){
        for (TemplateType item: TemplateType.values()){
            if (item.getValue().equals(value)){
                return item;
            }
        }

        throw new ConvertException("unknown TemplateType. status:" + value);
    }

}